<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/28
 * Time: 22:44
 */

session_start();
if (isset($_SESSION['name'])) {
    $name=$_SESSION['name'];

    require_once "php/config/config.php";
    require_once "php/model/adminDb.php";
    $adminDb=new adminDb();
    $not_change=0;
    $revised=1;
    $data=$adminDb->query_status_nr($not_change,$revised,$name);
    $count=count($data);

} else {
    echo "<script>window.location.href='php/view/login.php';</script>";

}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="static/js/layui/css/layui.css">
    <link rel="stylesheet" href="static/css/admin.css">
    <title>buglist</title>
    <style>

    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header custom-header">

        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item slide-sidebar" lay-unselect>
                <a href="javascript:;" class="icon-font"><i class="ai ai-menufold"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;" id="user_name"><?php echo $name ?></a>
                <dl class="layui-nav-child">
                    <dd><a onclick="clearSession()">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side custom-admin">
        <div class="layui-side-scroll">
            <div class="custom-logo">
                <h1>Bug List</h1>
            </div>
            <ul id="Nav" class="layui-nav layui-nav-tree">

                <li class="layui-nav-item">
                    <a href="php/view/myTask.php" id="nav">
                        <i class="layui-icon layui-icon-add-2"></i>
                        <em>我的任务<span class="layui-badge"><?php echo $count ?></span></em>
                    </a>
                </li>
                <li class="layui-nav-item">
                    <a href="php/view/bugList.php" id="nav">
                        <i class="layui-icon layui-icon-release"></i>
                        <em>bug列表</em>
                    </a>
                </li>


                <li class="layui-nav-item">
                    <a href="php/view/add_bug.php" >
                        <i class="layui-icon layui-icon-add-1"></i>
                        <em>新增bug</em>
                    </a>
                </li>
                <li class="layui-nav-item">
                    <a href="php/view/project.php" >
                        <i class="layui-icon layui-icon-component"></i>
                        <em>项目</em>
                    </a>
                </li>
                <li class="layui-nav-item">
                    <a href="php/view/user-list.php" >
                        <i class="layui-icon layui-icon-user"></i>
                        <em>用户</em>
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <div class="layui-tab app-container" lay-allowClose="true" lay-filter="tabs">
            <ul id="appTabs" class="layui-tab-title custom-tab"></ul>
            <div id="appTabPage" class="layui-tab-content">
            </div>
        </div>
    </div>

    <div class="layui-footer">
        <p>© bug List：<a target="_blank">xh  0.1</a></p>
    </div>

    <div class="mobile-mask"></div>
</div>
<script src="static/js/jquery-3.3.1.min.js"></script>
<script src="static/js/layui/layui.js"></script>
<script src="static/js/index.js" data-main="home"></script>

<script type="text/javascript">
    var url = document.location.toString();
    var name = url.split("=")[1];

    function clearSession() {
        layer.confirm('确定是否退出登录？', {
            btn: ['确定', '取消']
        }, function () {
            window.location.href = "php/controller/clear_session.php";
        }, function () {
            return false;
        })
    }


</script>
</body>
</html>